// 家庭关系表单
const jsonFormFamily = [
    {
        label: '姓名',
        fileName: 'family_name',
        rules: [
            {
                required: true,
                message: '请输入姓名'
            },
            {
                min: 2,
                max: 50,
                message: '请输入2~50个字符'
            },
            {
                pattern: /^[^\s]+(\s+[^\s]+)*$/,
                message: '此处不能输入空格'
            }
        ],
        type: 'input',
        placeholder: '请输入姓名'
    },
    {
        label: '与本人关系',
        fileName: 'family_relation',
        rules: [
            {
                required: true,
                message: '请选择与本人关系'
            }
        ],
        type: 'select',
        code: 'emergencyRelationship',
        placeholder: '请选择与本人关系'
    },
    {
        label: '住址',
        fileName: 'family_address',
        rules: [
            {
                required: true,
                message: '请输入住址'
            },
            {
                min: 1,
                max: 50,
                message: '请输入1~50个字符'
            },
            {
                pattern: /^[^\s]+(\s+[^\s]+)*$/,
                message: '此处不能输入空格'
            }
        ],
        type: 'input',
        placeholder: '请输入住址'
    },
    {
        label: '工作/学习单位',
        fileName: 'family_work',
        rules: [
            {
                required: true,
                message: '请输入工作/学习单位'
            },
            {
                min: 1,
                max: 50,
                message: '请输入1~50个字符'
            },
            {
                pattern: /^[^\s]+(\s+[^\s]+)*$/,
                message: '此处不能输入空格'
            }
        ],
        type: 'input',
        placeholder: '请输入工作/学习单位'
    },
    {
        label: '联系方式',
        fileName: 'family_contact',
        rules: [
            {
                required: true,
                validator(rule, value, callback) {
                    const regex = /^\d{7,11}$/;
                    if (!value) {
                        callback('手机号不能为空');
                    } else if (!regex.test(value)) {
                        callback('只能输入7-11位数字');
                    }
                    callback();
                }
            }
        ],
        type: 'tel'
    },
    {
        label: '是否同住',
        fileName: 'family_liveTogether',
        rules: [
            {
                required: true,
                message: '请选择是否同住'
            }
        ],
        type: 'radio',
        code: 'liveTogether'
    }
];

// 工作关系表单
const jsonFormWork = [
    {
        label: '起止时间',
        fileName: 'work_startTime',
        type: 'time',
        rules: [
            {
                required: true,
                message: '请选择起止时间'
            }
        ]
    },
    {
        label: '工作单位',
        fileName: 'work_organize',
        rules: [
            {
                required: true,
                message: '请输入工作单位'
            },
            {
                pattern: /^[^\s]+(\s+[^\s]+)*$/,
                message: '此处不能输入空格'
            },
            {
                min: 1,
                max: 50,
                message: '请输入1~50个字符'
            }
        ],
        type: 'input',
        placeholder: '请输入工作单位'
    },
    {
        label: '行业/主营业务',
        fileName: 'work_industry',
        rules: [
            {
                required: true,
                message: '请输入行业/主营业务'
            },
            {
                min: 1,
                max: 50,
                message: '请输入1~50个字符'
            },
            {
                pattern: /^[^\s]+(\s+[^\s]+)*$/,
                message: '此处不能输入空格'
            }
        ],
        type: 'select',
        code: 'industryType',
        placeholder: '请输入行业/主营业务'
    },
    {
        label: '职位',
        fileName: 'work_post',
        rules: [
            {
                min: 1,
                max: 50,
                message: '请输入1~50个字符'
            },
            {
                pattern: /^[^\s]+(\s+[^\s]+)*$/,
                message: '此处不能输入空格'
            },
            {
                required: true,
                message: '请输入职位'
            }
        ],
        type: 'input',
        placeholder: '请输入职位'
    },
    {
        label: '离职原因',
        fileName: 'work_reason',
        rules: [
            {
                min: 1,
                max: 50,
                message: '请输入1~50个字符'
            },
            {
                pattern: /^[^\s]+(\s+[^\s]+)*$/,
                message: '此处不能输入空格'
            },
            {
                required: true,
                message: '请输入离职原因'
            }
        ],
        type: 'input',
        placeholder: '请输入离职原因'
    },
    {
        label: '证明联系人',
        fileName: 'work_approveName',
        rules: [
            {
                min: 1,
                max: 50,
                message: '请输入1~50个字符'
            },
            {
                pattern: /^[^\s]+(\s+[^\s]+)*$/,
                message: '此处不能输入空格'
            },
            {
                required: true,
                message: '请输入证明联系人'
            }
        ],
        type: 'input',
        placeholder: '请输入证明联系人'
    },
    {
        label: '联系人电话',
        fileName: 'work_approvePhone',
        rules: [
            {
                required: true,
                validator(rule, value, callback) {
                    const regex = /^\d{7,11}$/;
                    if (value) {
                        if (!regex.test(value)) {
                            callback('只能输入7-11位数字');
                        }
                    }
                    callback();
                }
            }
        ],
        type: 'tel'
    }
];

// 教育经历表单
const jsonFormSchool = [
    {
        label: '起止时间',
        fileName: 'school_startTime',
        rules: [
            {
                required: true,
                message: '请选择起止时间'
            }
        ],
        type: 'time'
    },
    {
        label: '学校名称',
        fileName: 'school_graduateSchool',
        rules: [
            {
                required: true,
                message: '请输入学校名称'
            },
            {
                min: 1,
                max: 50,
                message: '请输入1~50个字符'
            },
            {
                pattern: /^[^\s]+(\s+[^\s]+)*$/,
                message: '此处不能输入空格'
            }
        ],
        type: 'input',
        placeholder: '请输入学校名称'
    },
    {
        label: '专业',
        fileName: 'school_major',
        rules: [
            {
                required: true,
                message: '请输入专业名称'
            },
            {
                min: 1,
                max: 50,
                message: '请输入1~50个字符'
            },
            {
                pattern: /^[^\s]+(\s+[^\s]+)*$/,
                message: '此处不能输入空格'
            }
        ],
        type: 'input',
        placeholder: '请输入专业名称'
    },
    {
        label: '学制',
        fileName: 'school_academicYear',
        rules: [
            {
                required: true,
                message: '请输入学制'
            },
            {
                min: 1,
                max: 50,
                message: '请输入1~50个字符'
            },
            {
                pattern: /^[^\s]+(\s+[^\s]+)*$/,
                message: '此处不能输入空格'
            }
        ],
        type: 'select',
        code: 'academicYear',
        placeholder: '请输入学制'
    },
    {
        label: '毕业证书',
        fileName: 'school_certificate',
        rules: [
            {
                required: true,
                message: '请输入毕业证书'
            },
            {
                min: 1,
                max: 50,
                message: '请输入1~50个字符'
            },
            {
                pattern: /^[^\s]+(\s+[^\s]+)*$/,
                message: '此处不能输入空格'
            }
        ],
        type: 'input',
        placeholder: '请选择毕业证书'
    }
];

// 培训经历表单
const jsonFormTrain = [
    {
        label: '起止时间',
        fileName: 'train_startTime',
        type: 'time'
    },
    {
        label: '培训主题/内容',
        fileName: 'train_trainContent',
        type: 'input',
        placeholder: '请输入培训主题/内容',
        rules: [
            {
                min: 1,
                max: 50,
                message: '请输入1~50个字符'
            }
        ]
    },
    {
        label: '培训机构',
        fileName: 'train_trainOrganize',
        type: 'input',
        placeholder: '请输入培训机构',
        rules: [
            {
                min: 1,
                max: 50,
                message: '请输入1~50个字符'
            },
            {
                pattern: /^[^\s]+(\s+[^\s]+)*$/,
                message: '此处不能输入空格'
            }
        ]
    },
    {
        label: '证书',
        fileName: 'train_certificate',
        type: 'input',
        placeholder: '请输入证书',
        rules: [
            {
                min: 1,
                max: 50,
                message: '请输入1~50个字符'
            },
            {
                pattern: /^[^\s]+(\s+[^\s]+)*$/,
                message: '此处不能输入空格'
            }
        ]
    }
];

// 获奖记录表单
const jsonFormAward = [
    {
        label: '获奖时间',
        fileName: 'award_awardTime',
        type: 'time2'
    },
    {
        label: '奖项名称',
        fileName: 'award_awardName',
        type: 'input',
        placeholder: '请输入奖项名称',
        rules: [
            {
                min: 1,
                max: 50,
                message: '请输入1~50个字符'
            },
            {
                pattern: /^[^\s]+(\s+[^\s]+)*$/,
                message: '此处不能输入空格'
            }
        ]
    },
    {
        label: '颁发机构',
        fileName: 'award_organize',
        type: 'input',
        placeholder: '请输入颁发机构',
        rules: [
            {
                min: 1,
                max: 50,
                message: '请输入1~50个字符'
            },
            {
                pattern: /^[^\s]+(\s+[^\s]+)*$/,
                message: '此处不能输入空格'
            }
        ]
    }
];

const form1VerificationField = [
    'employeeName',
    'sex',
    'email',
    'idCard',
    'postCode',
    'workYear',
    'workMonth',
    'nationalArea',
    'address',
    'detailAddress',
    'emergencyContact',
    'emergencyRelationship',
    'birthday',
    'areaCode',
    'mobile',
    'emergencyAreaCode',
    'emergencyTelephone',
    'highestDegree'
];
const map = {
    family_name: 'name',
    family_relation: 'relation',
    family_address: 'address',
    family_work: 'work',
    family_contact: 'contact',
    family_liveTogether: 'liveTogether',

    // work_startTime: '',
    work_organize: 'organize',
    work_industry: 'industry',
    work_post: 'post',
    work_reason: 'reason',
    work_approveName: 'approveName',
    work_approvePhone: 'approvePhone',

    // school_startTime: 'name',
    school_graduateSchool: 'graduateSchool',
    school_major: 'major',
    school_academicYear: 'academicYear',
    school_certificate: 'certificate',

    // train_startTime: 'name',
    train_trainContent: 'trainContent',
    train_trainTime: 'trainTime',
    train_trainOrganize: 'trainOrganize',
    train_certificate: 'certificate',

    award_awardTime: 'awardTime',
    award_awardName: 'awardName',
    award_organize: 'organize'
};
export { jsonFormWork, jsonFormFamily, jsonFormSchool, jsonFormTrain, jsonFormAward, form1VerificationField, map };
